<?php
    class HangveController extends Controller
    {
        public $siteName = 'Hàng Về';
        public $siteSlogan = 'Cộng đồng mua bán';

        public $ogImage;         
        public $ogTitle;         

        public $user;
        public $userInfo;
        
        public $topNav = 'hangve';
        
        
        /**
        * All cat objects
        */
        public $cats;
        /**
        * All city objects
        */
        public $cities;
        /**
        * Current city object
        */
        public $city;
        
        public $googleMapURI;
        
        public function init(){
            parent::init();

            // init properties 
            if(!Yii::app()->user->isGuest){
                $this->user = Yii::app()->user->user;
                $this->userInfo = Yii::app()->user->userInfo;
            }
            
            if(isset($_GET['genpostcat'])){
                PostCat::model()->genarateCat();
                die('DONE');  
            } 
 
            
            $this->cats = PostCat::model()->getDataAll();

            $this->cities = City::model()->getDataAll();

            $this->city   = Yii::app()->webData->city;
            
            $this->socialUrl = "http://{$this->domain}/";
            $this->googleMapURI = "https://maps.googleapis.com/maps/api/js?key=".Myext::getRandomArray(Yii::app()->params->google['apiKey'])."&sensor=true&language=vi";

        }
}